package router

import (
	"github.com/gin-gonic/gin"
	"wechat-moments_0926/internal/service"
)

func Router(r *gin.Engine) {
	user := r.Group("/user")
	{
		//注册
		user.POST("register", service.RegisterUser)
		//登陆
		user.POST("login", service.LoginUser)

		//动态
		feed := user.Group("/feed")
		{
			//朋友圈动态 发布
			feed.POST("add", service.AddFeed)
			//列表
			feed.GET("list", service.ListFeed)
		}

		//点赞
		like := user.Group("/like")
		{
			//点赞
			like.POST("add", service.AddLike)
		}
		//评论
		comment := user.Group("/comment")
		{
			//评论动态
			comment.POST("add", service.AddComment)
		}
	}

	//文件上传
	r.POST("uploadFile", service.FileUpload)

}
